package com.chinairi.mall.error;



/**
 * @author web
 */

public enum EmBusinessError implements CommonError {
    //通用错误类型
    PARAMETER_VALIDATION_ERROR(10001,"参数不合法"),
    UNKNOWN_ERROR(10002,"未知错误"),
    PHONE_CODE(10003,"手机验证码错误"),
    PLEASE_LOGIN(10004,"请登录"),
    PLEASE_LOGIN2(10011,"请登录2"),
    NO_PERMISSION(10005,"没有权限"),

    Three_MONTH(10006,"三个月未修改密码"),

    ADMINISTRATORS(10007,"角色超级管理员不能变更"),
    LOGIN_ALREADY(10008,"你已经登录，请不要重复登录"),
    IP_LOGIN_ALREADY(10009,"此IP已经登录一个账号，请退出后操作"),

    ARREARS(10010,"验证码错误"),
    PHONE_CODE_OUTTIME(10012,"手机验证码超时"),
    //20000为用户信息相关错误
    STUDENT_NOT_EXIST(20001,"用户不存在"),
    STUDENT_LOGIN_FAIL(20002,"请输入正确的帐号或密码"),
    STUDENT_LOGIN_TOO_MANY(20003,"密码输入错误超过5次，请明天再登录"),

    ITEMS_Exist(30001,"条目已存在，请确认后输入"),

    ;

    /**
     * 构造函数。
     * @param errCode
     * @param errMsg
     */
    private EmBusinessError(int errCode, String errMsg){
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    /**
     *  //枚举允许具有成员变量。
     */
    private final int errCode;
    private String errMsg;

    @Override
    public int getErrCode() {
        return this.errCode;
    }

    @Override
    public String getErrMsg() {
        return this.errMsg;
    }

    @Override
    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
